package drds.data_migrate.task_group;


import drds.common.Author;
import drds.data_migrate.Authors;
import drds.data_migrate.vo.Status;
import lombok.Getter;
import lombok.Setter;

@Author(name = Authors.LI_YANG)
public class TaskGroupTask implements Runnable
{
    @Setter
    @Getter
    private TaskGroupContainer taskGroupContainer;
    @Setter
    @Getter
    private Status status;

    public TaskGroupTask(TaskGroupContainer taskGroupContainer)
    {
        this.taskGroupContainer = taskGroupContainer;
        this.status = Status.succeeded;
    }


    public void run()
    {
        try
        {
            this.taskGroupContainer.run();
            this.status = Status.succeeded;
        } catch (Throwable e)
        {
            this.status = Status.failed;
            throw new RuntimeException();
        }
    }


}
